#include "sk_game_element_by_string.h"

#include "sk_box_shape.h"
#include "sk_circle_shape.h"
#include "sk_triangle_shape.h"

namespace sk
{

GameShape * GameElementByString::gameShape(QString type)
{
    if (type.isEmpty())
    {
        return 0;
    }
    if (type == BoxShape::XmlType())
    {
        return new BoxShape();
    }
    else
    if (type == CircleShape::XmlType())
    {
        return new CircleShape();
    }
    else
    if (type == TriangleShape::XmlType())
    {
        return new TriangleShape();
    }
    return 0;
}

} // namespace sk
